#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "uthash.h"

#include <iso646.h>

int findJudge(int n, int** trust, int trustSize, int* trustColSize);

int main()
{
	return 0;
}

int findJudge(int n, int** trust, int trustSize, int* trustColSize)
{
	int* trusted = (int*)calloc(n + 1, sizeof(int));
	char* has_trust = (char*)calloc(n + 1, sizeof(char));

	for (int i = 0; i < trustSize; i++) {
		has_trust[trust[i][0]] |= 1;
		trusted[trust[i][1]]++;
	}

	int res = -1;
	for (int i = 1; i <= n; i++) {
		if (has_trust[i]) continue;
		if (trusted[i] == n - 1)
			if (res == -1)
				res = i;
			else
				return -1;
	}

	free(trusted); free(has_trust);
	return res;
}
